package com.service.infoEntry.service;

import com.service.config.utils.Result;
import com.service.infoEntry.dto.ProgrammeInfoDto;
import com.service.infoEntry.dto.ProgrammeInfoDto2;
import com.service.infoEntry.dto.UserDto;
import com.service.infoEntry.entity.ContentOfUpdateInfo;
import com.service.infoEntry.entity.ProgrammeInfo;
import com.service.infoEntry.vo.ProgrammeVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface ProgrammeService {
    /**
     * 立项
     * @param programmeInfoDto
     * @param userDto
     * @return
     */
    Result setUpProgramme(ProgrammeInfoDto programmeInfoDto, UserDto userDto);
    /**
     * 项目跟踪
     * @param programmeInfoDto
     * @param userDto
     * @return
     */
    Result updateProgrammeInfo(ProgrammeInfoDto programmeInfoDto, UserDto userDto);

    /**
     * 项目关闭
     * @param programmeInfoDto
     * @param userId
     */
    Result closeProgramme(ProgrammeInfoDto programmeInfoDto, String userId);

    /**
     * 通过项目id查询分组下某一个项目
     * @param programmeNo
     * @param userId
     * @return
     */
    ProgrammeVo queryProgrammeOfTeamById(String programmeNo,String userId,String teamId);

    /**
     * 附件上传
     * @param files
     * @return
     */
    String uploadAccessory(MultipartFile[] files);

    /**
     * 下载项目附件
     * @param accessoryName
     * @return
     */
    void downloadAccessory(String accessoryName, HttpServletResponse response) throws IOException;

    /**
     * 查询项目下所有附件
     * @param programmeId
     * @return
     */
    List<Map<String, String>> queryAccessory(String programmeId);

    /**
     * 删除
     * @param accessoryName
     */
    Result deleteAccessory(String programmeId,String accessoryName);

    /**
     * 通过项目id查询项目信息
     * @param programmeId
     * @return
     */
    ProgrammeInfo queryProgrammeById(String programmeId,String userId,String teamId);

    /**
     * 导出团队下所有项目清单
     * @param teamId
     * @return
     */
    Result exportProgrammeList(String teamId,String userId);

    /**
     * 查询团队中所有项目
     * @param teamId
     * @return
     */
    List<ProgrammeVo> queryAllProgrammeInTeam(String teamId,String userId);

    Map<String, Object> queryProgramme(String teamId, String userId, String name, Integer status, Integer programmeStatus, Integer page);

    ProgrammeVo queryProgrammeByNo(String programmeId);

    List<ProgrammeInfo> queryAllByDate(ProgrammeInfo programmeInfo);

    public void downloadModelProgrammeList(HttpServletResponse response) throws IOException;


    /**
     * 项目清单上传
     * @param file
     * @return
     */
    Result uploadProgrammeList(MultipartFile file, String teamId, UserDto userDto) throws Exception;

    /**
     * 删除项目
     * @param teamId
     * @param no
     * @param userDto
     * @return
     */
    Result deleteProgrammeOrTransaction(String teamId, String no,String type, UserDto userDto);

    /**
     * 查询团队下已删除项目
     * @param teamId
     * @param userId
     * @return
     */
    Map<String,Object> queryDeletedProgrammeOrTransaction(String teamId, String userId,String type,Integer page,String name) throws Exception;

    List<ContentOfUpdateInfo> queryUpdateProcess(String teamId, String userId, String programmeNo);
}
